clear;

## Parameters for the function to be transformed
c = 1.4;
A = 3;

t     = linspace(0, 10, 1000);
omega = linspace(0, 125, 1000);

## Analytical expressions
y = A*exp(-c.*t);
Y = A./(c + I.*omega);

## Numerical F-L transform
Yn = fltrans(t, y, omega);

figure(1);
plot(omega, real(Y),'b', omega, real(Yn), 'bo',
     omega, imag(Y), 'r', omega, imag(Yn), 'ro');

##Patching
l = length(Y);

Z = [real(Y(l:-1:1)), real(Y)];
W = [-imag(Y(l:-1:1)), imag(Y)];
Y = Z + I.*W;

omega = [-omega(l:-1:1), omega];

## Inverse F-L transform
yn = ifltrans(omega, Y, t);

figure(2);
plot(t, real(y), 'b', t, real(yn), 'bo',
     t, imag(y), 'r', t, imag(yn), 'ro');
